<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>PxSerializer.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="PhysXLogoBlack.png"/></td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('PxSerializer_8h_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">PxSerializer.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="PxSerializer_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">// Redistribution and use in source and binary forms, with or without</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// modification, are permitted provided that the following conditions</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// are met:</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//  * Redistributions of source code must retain the above copyright</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">//    notice, this list of conditions and the following disclaimer.</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">//  * Redistributions in binary form must reproduce the above copyright</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//    notice, this list of conditions and the following disclaimer in the</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">//    documentation and/or other materials provided with the distribution.</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">//  * Neither the name of NVIDIA CORPORATION nor the names of its</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">//    contributors may be used to endorse or promote products derived</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//    from this software without specific prior written permission.</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS &#39;&#39;AS IS&#39;&#39; AND ANY</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">// PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment">// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment">// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment">// Copyright (c) 2008-2021 NVIDIA Corporation. All rights reserved.</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment">// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment">// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.  </span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#ifndef PX_SERIALIZER_H</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#define PX_SERIALIZER_H</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="PxAssert_8h.html">foundation/PxAssert.h</a>&quot;</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="PxAllocatorCallback_8h.html">foundation/PxAllocatorCallback.h</a>&quot;</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="PxSerialFramework_8h.html">common/PxSerialFramework.h</a>&quot;</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="PxCollection_8h.html">common/PxCollection.h</a>&quot;</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="PxFoundation_8h.html">PxFoundation.h</a>&quot;</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#if !PX_DOXYGEN</span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacephysx.html">physx</a></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;{</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="classPxSerializer.html">   64</a></span>&#160;<span class="keyword">class </span><a class="code" href="classPxSerializer.html">PxSerializer</a></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;{</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="comment">/**********************************************************************************************************************/</span></div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    </div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keyword">virtual</span>  <span class="keyword">const</span>  <span class="keywordtype">char</span>*           getConcreteTypeName() <span class="keyword">const</span>                                                         = 0;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keyword">virtual</span>         <span class="keywordtype">void</span>            requiresObjects(<a class="code" href="classPxBase.html">PxBase</a>&amp;, <a class="code" href="classPxProcessPxBaseCallback.html">PxProcessPxBaseCallback</a>&amp;) <span class="keyword">const</span>                                    = 0;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    </div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keyword">virtual</span>         <span class="keywordtype">bool</span>            isSubordinate() <span class="keyword">const</span>                                                               = 0;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="comment">/**********************************************************************************************************************/</span></div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="comment">/**********************************************************************************************************************/</span></div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="keyword">virtual</span>         <span class="keywordtype">void</span>            exportExtraData(<a class="code" href="classPxBase.html">PxBase</a>&amp;, <a class="code" href="classPxSerializationContext.html">PxSerializationContext</a>&amp;) <span class="keyword">const</span>                             = 0;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="keyword">virtual</span>         <span class="keywordtype">void</span>            exportData(<a class="code" href="classPxBase.html">PxBase</a>&amp;, <a class="code" href="classPxSerializationContext.html">PxSerializationContext</a>&amp;) <span class="keyword">const</span>                                  = 0;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keyword">virtual</span>         <span class="keywordtype">void</span>            registerReferences(<a class="code" href="classPxBase.html">PxBase</a>&amp; obj, <a class="code" href="classPxSerializationContext.html">PxSerializationContext</a>&amp; s) <span class="keyword">const</span>                    = 0;</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <span class="keyword">virtual</span>         <span class="keywordtype">size_t</span>          getClassSize() <span class="keyword">const</span>                                                                = 0;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keyword">virtual</span>         <a class="code" href="classPxBase.html">PxBase</a>*         createObject(<a class="code" href="namespacephysx.html#a3849f86abc21d3a58949481603fe8309">PxU8</a>*&amp; address, <a class="code" href="classPxDeserializationContext.html">PxDeserializationContext</a>&amp; context) <span class="keyword">const</span>   = 0; </div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <span class="comment">/**********************************************************************************************************************/</span></div><div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="classPxSerializer.html#a96746551fdacb2df8da8f2887817ff5f">  143</a></span>&#160;    <span class="keyword">virtual</span> <a class="code" href="classPxSerializer.html#a96746551fdacb2df8da8f2887817ff5f">~PxSerializer</a>() {}</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;};</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;</div><div class="line"><a name="l00151"></a><span class="lineno"><a class="line" href="classPxSerializerDefaultAdapter.html">  151</a></span>&#160;<span class="keyword">class </span><a class="code" href="classPxSerializerDefaultAdapter.html">PxSerializerDefaultAdapter</a> : <span class="keyword">public</span> <a class="code" href="classPxSerializer.html">PxSerializer</a></div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;{</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    <span class="comment">/************************************************************************************************/</span></div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno"><a class="line" href="classPxSerializerDefaultAdapter.html#a3a59a446ea4fc277d0c224881c2f8658">  161</a></span>&#160;    <a class="code" href="classPxSerializerDefaultAdapter.html#a3a59a446ea4fc277d0c224881c2f8658">PxSerializerDefaultAdapter</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* name) : mTypeName(name){}</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;</div><div class="line"><a name="l00163"></a><span class="lineno"><a class="line" href="classPxSerializerDefaultAdapter.html#a58327906eee1c1d30c935af420e91fcd">  163</a></span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classPxSerializerDefaultAdapter.html#a58327906eee1c1d30c935af420e91fcd">getConcreteTypeName</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;<span class="keyword">    </span>{ </div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;        <span class="keywordflow">return</span> mTypeName; </div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    }</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    </div><div class="line"><a name="l00168"></a><span class="lineno"><a class="line" href="classPxSerializerDefaultAdapter.html#a480df87ac9da1fa02e6384258cd99f1a">  168</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPxSerializerDefaultAdapter.html#a480df87ac9da1fa02e6384258cd99f1a">requiresObjects</a>(<a class="code" href="classPxBase.html">PxBase</a>&amp; obj, <a class="code" href="classPxProcessPxBaseCallback.html">PxProcessPxBaseCallback</a>&amp; c)<span class="keyword"> const</span></div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;<span class="keyword">    </span>{</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;        T&amp; t = <span class="keyword">static_cast&lt;</span>T&amp;<span class="keyword">&gt;</span>(obj);</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;        t.requiresObjects(c);</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    }</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;</div><div class="line"><a name="l00174"></a><span class="lineno"><a class="line" href="classPxSerializerDefaultAdapter.html#a3b5eab93ab615326e85bef5a918d6974">  174</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="classPxSerializerDefaultAdapter.html#a3b5eab93ab615326e85bef5a918d6974">isSubordinate</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;<span class="keyword">    </span>{</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    }</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;        </div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    <span class="comment">/************************************************************************************************/</span></div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;    <span class="comment">// object methods</span></div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;</div><div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="classPxSerializerDefaultAdapter.html#a90784fea8b148d20c0688a8269fa2099">  188</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPxSerializerDefaultAdapter.html#a90784fea8b148d20c0688a8269fa2099">exportExtraData</a>(<a class="code" href="classPxBase.html">PxBase</a>&amp; obj, <a class="code" href="classPxSerializationContext.html">PxSerializationContext</a>&amp; s)<span class="keyword"> const</span></div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;<span class="keyword">    </span>{ </div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        T&amp; t = <span class="keyword">static_cast&lt;</span>T&amp;<span class="keyword">&gt;</span>(obj);</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;        t.exportExtraData(s);</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;    }</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;</div><div class="line"><a name="l00194"></a><span class="lineno"><a class="line" href="classPxSerializerDefaultAdapter.html#a3514c52a4f55add2174bd05600f7d992">  194</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPxSerializerDefaultAdapter.html#a3514c52a4f55add2174bd05600f7d992">exportData</a>(<a class="code" href="classPxBase.html">PxBase</a>&amp; obj, <a class="code" href="classPxSerializationContext.html">PxSerializationContext</a>&amp; s)<span class="keyword"> const</span></div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;<span class="keyword">    </span>{</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;        <a class="code" href="classPxAllocatorCallback.html">PxAllocatorCallback</a>&amp; allocator = <a class="code" href="group__foundation.html#ga2f06b47e22c6e93701d766444c67f3a6">PxGetFoundation</a>().getAllocatorCallback();</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;        T* copy = <span class="keyword">reinterpret_cast&lt;</span>T*<span class="keyword">&gt;</span>(allocator.<a class="code" href="classPxAllocatorCallback.html#a7bb2dde434cf541a556b40b31661da29">allocate</a>(<span class="keyword">sizeof</span>(T), <span class="stringliteral">&quot;TmpAllocExportData&quot;</span>, __FILE__, __LINE__));</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;        <a class="code" href="group__foundation.html#ga939562c42c614caac1aaba467f77d510">PxMemCopy</a>(copy, &amp;obj, <span class="keyword">sizeof</span>(T));</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;        copy-&gt;preExportDataReset();</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;        s.<a class="code" href="classPxSerializationContext.html#a2cb3cc1613a70406c2bf89ec53035a22">writeData</a>(copy, <span class="keyword">sizeof</span>(T));</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;        allocator.<a class="code" href="classPxAllocatorCallback.html#a6af8b56b5a786150796b9854d16fde38">deallocate</a>(copy);</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    }</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;</div><div class="line"><a name="l00204"></a><span class="lineno"><a class="line" href="classPxSerializerDefaultAdapter.html#a01096d2cb96608bfbae8ab7509a9439f">  204</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPxSerializerDefaultAdapter.html#a01096d2cb96608bfbae8ab7509a9439f">registerReferences</a>(<a class="code" href="classPxBase.html">PxBase</a>&amp; obj, <a class="code" href="classPxSerializationContext.html">PxSerializationContext</a>&amp; s)<span class="keyword"> const</span></div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;<span class="keyword">    </span>{</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;        T&amp; t = <span class="keyword">static_cast&lt;</span>T&amp;<span class="keyword">&gt;</span>(obj);</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;        s.<a class="code" href="classPxSerializationContext.html#ade8ef3b58a16bab4f4cbd3c04a891817">registerReference</a>(obj, <a class="code" href="group__common.html#ga8cd51251f2e11c3b6598b96f32e400f8">PX_SERIAL_REF_KIND_PXBASE</a>, <span class="keywordtype">size_t</span>(&amp;obj));</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;        <span class="keyword">struct </span>RequiresCallback : <span class="keyword">public</span> <a class="code" href="classPxProcessPxBaseCallback.html">PxProcessPxBaseCallback</a></div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;        {</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;            RequiresCallback(<a class="code" href="classPxSerializationContext.html">PxSerializationContext</a>&amp; c) : context(c) {}</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;            RequiresCallback&amp; operator=(RequiresCallback&amp;) { <a class="code" href="group__foundation.html#ga4a83a657390b324a460f14684e5accee">PX_ASSERT</a>(0); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;            <span class="keywordtype">void</span> process(physx::PxBase&amp; base)</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;            {               </div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;                context.registerReference(base, <a class="code" href="group__common.html#ga8cd51251f2e11c3b6598b96f32e400f8">PX_SERIAL_REF_KIND_PXBASE</a>, <span class="keywordtype">size_t</span>(&amp;base));</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;            }</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;            <a class="code" href="classPxSerializationContext.html">PxSerializationContext</a>&amp; context;</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;        };</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;        RequiresCallback callback(s);</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;        t.requiresObjects(callback);</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    }</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    <span class="comment">// class methods</span></div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;</div><div class="line"><a name="l00227"></a><span class="lineno"><a class="line" href="classPxSerializerDefaultAdapter.html#aea2cb77a709074813a634343497a4f6e">  227</a></span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> <a class="code" href="classPxSerializerDefaultAdapter.html#aea2cb77a709074813a634343497a4f6e">getClassSize</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;<span class="keyword">    </span>{</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">sizeof</span>(T);</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;    }</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;</div><div class="line"><a name="l00232"></a><span class="lineno"><a class="line" href="classPxSerializerDefaultAdapter.html#a8b025cc71d171a5d5f1d1dc0fe816545">  232</a></span>&#160;    <span class="keyword">virtual</span> <a class="code" href="classPxBase.html">PxBase</a>* <a class="code" href="classPxSerializerDefaultAdapter.html#a8b025cc71d171a5d5f1d1dc0fe816545">createObject</a>(<a class="code" href="namespacephysx.html#a3849f86abc21d3a58949481603fe8309">PxU8</a>*&amp; address, <a class="code" href="classPxDeserializationContext.html">PxDeserializationContext</a>&amp; context)<span class="keyword"> const</span></div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;<span class="keyword">    </span>{</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;        <span class="keywordflow">return</span> T::createObject(address, context);</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;    }</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;</div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    <span class="comment">/************************************************************************************************/</span></div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00242"></a><span class="lineno"><a class="line" href="classPxSerializerDefaultAdapter.html#a12385fd1d59f49f27aed66c91b5d647c">  242</a></span>&#160;    <span class="keyword">const</span> <span class="keywordtype">char</span>*    <a class="code" href="classPxSerializerDefaultAdapter.html#a12385fd1d59f49f27aed66c91b5d647c">mTypeName</a>;   </div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;};</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;</div><div class="line"><a name="l00250"></a><span class="lineno"><a class="line" href="group__extensions.html#ga8695b63c3fd0f8e29ecce92c64e8f79b">  250</a></span>&#160;<span class="preprocessor">#define PX_NEW_SERIALIZER_ADAPTER(x) \</span></div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;<span class="preprocessor">    *new( PxGetFoundation().getAllocatorCallback().allocate(sizeof(PxSerializerDefaultAdapter&lt;x&gt;), \</span></div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;<span class="preprocessor">    &quot;PxSerializerDefaultAdapter&quot;,  __FILE__, __LINE__ )) PxSerializerDefaultAdapter&lt;x&gt;(#x)</span></div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;</div><div class="line"><a name="l00257"></a><span class="lineno"><a class="line" href="group__extensions.html#gaf9d523f77e7143a4c7e49424d9f0081e">  257</a></span>&#160;<span class="preprocessor">#define PX_DELETE_SERIALIZER_ADAPTER(x) \</span></div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;<span class="preprocessor">    { PxSerializer* s = x; if (s) { s-&gt;~PxSerializer(); PxGetFoundation().getAllocatorCallback().deallocate(s); } }</span></div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;</div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;<span class="preprocessor">#if !PX_DOXYGEN</span></div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;} <span class="comment">// namespace physx</span></div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="namespacephysx_html"><div class="ttname"><a href="namespacephysx.html">physx</a></div><div class="ttdef"><b>Definition:</b> GuContactBuffer.h:37</div></div>
<div class="ttc" id="group__common_html_ga8cd51251f2e11c3b6598b96f32e400f8"><div class="ttname"><a href="group__common.html#ga8cd51251f2e11c3b6598b96f32e400f8">PX_SERIAL_REF_KIND_PXBASE</a></div><div class="ttdeci">#define PX_SERIAL_REF_KIND_PXBASE</div><div class="ttdoc">Reference kind value for PxBase objects. </div><div class="ttdef"><b>Definition:</b> PxSerialFramework.h:68</div></div>
<div class="ttc" id="classPxSerializerDefaultAdapter_html_a90784fea8b148d20c0688a8269fa2099"><div class="ttname"><a href="classPxSerializerDefaultAdapter.html#a90784fea8b148d20c0688a8269fa2099">PxSerializerDefaultAdapter::exportExtraData</a></div><div class="ttdeci">virtual void exportExtraData(PxBase &amp;obj, PxSerializationContext &amp;s) const</div><div class="ttdoc">Exports object&amp;#39;s extra data to stream. </div><div class="ttdef"><b>Definition:</b> PxSerializer.h:188</div></div>
<div class="ttc" id="group__foundation_html_ga939562c42c614caac1aaba467f77d510"><div class="ttname"><a href="group__foundation.html#ga939562c42c614caac1aaba467f77d510">PxMemCopy</a></div><div class="ttdeci">PX_FORCE_INLINE void * PxMemCopy(void *dest, const void *src, PxU32 count)</div><div class="ttdoc">Copies the bytes of one memory block to another. The memory blocks must not overlap. </div><div class="ttdef"><b>Definition:</b> PxMemory.h:84</div></div>
<div class="ttc" id="classPxSerializerDefaultAdapter_html_a3514c52a4f55add2174bd05600f7d992"><div class="ttname"><a href="classPxSerializerDefaultAdapter.html#a3514c52a4f55add2174bd05600f7d992">PxSerializerDefaultAdapter::exportData</a></div><div class="ttdeci">virtual void exportData(PxBase &amp;obj, PxSerializationContext &amp;s) const</div><div class="ttdoc">Exports object&amp;#39;s data to stream. </div><div class="ttdef"><b>Definition:</b> PxSerializer.h:194</div></div>
<div class="ttc" id="PxCollection_8h_html"><div class="ttname"><a href="PxCollection_8h.html">PxCollection.h</a></div></div>
<div class="ttc" id="classPxSerializerDefaultAdapter_html_a480df87ac9da1fa02e6384258cd99f1a"><div class="ttname"><a href="classPxSerializerDefaultAdapter.html#a480df87ac9da1fa02e6384258cd99f1a">PxSerializerDefaultAdapter::requiresObjects</a></div><div class="ttdeci">virtual void requiresObjects(PxBase &amp;obj, PxProcessPxBaseCallback &amp;c) const</div><div class="ttdoc">Adds required objects to the collection. </div><div class="ttdef"><b>Definition:</b> PxSerializer.h:168</div></div>
<div class="ttc" id="PxSerialFramework_8h_html"><div class="ttname"><a href="PxSerialFramework_8h.html">PxSerialFramework.h</a></div></div>
<div class="ttc" id="classPxSerializer_html"><div class="ttname"><a href="classPxSerializer.html">PxSerializer</a></div><div class="ttdoc">Serialization interface class. </div><div class="ttdef"><b>Definition:</b> PxSerializer.h:64</div></div>
<div class="ttc" id="classPxAllocatorCallback_html_a6af8b56b5a786150796b9854d16fde38"><div class="ttname"><a href="classPxAllocatorCallback.html#a6af8b56b5a786150796b9854d16fde38">PxAllocatorCallback::deallocate</a></div><div class="ttdeci">virtual void deallocate(void *ptr)=0</div><div class="ttdoc">Frees memory previously allocated by allocate(). </div></div>
<div class="ttc" id="PxAssert_8h_html"><div class="ttname"><a href="PxAssert_8h.html">PxAssert.h</a></div></div>
<div class="ttc" id="classPxAllocatorCallback_html_a7bb2dde434cf541a556b40b31661da29"><div class="ttname"><a href="classPxAllocatorCallback.html#a7bb2dde434cf541a556b40b31661da29">PxAllocatorCallback::allocate</a></div><div class="ttdeci">virtual void * allocate(size_t size, const char *typeName, const char *filename, int line)=0</div><div class="ttdoc">Allocates size bytes of memory, which must be 16-byte aligned. </div></div>
<div class="ttc" id="namespacephysx_html_a3849f86abc21d3a58949481603fe8309"><div class="ttname"><a href="namespacephysx.html#a3849f86abc21d3a58949481603fe8309">physx::PxU8</a></div><div class="ttdeci">uint8_t PxU8</div><div class="ttdef"><b>Definition:</b> PxSimpleTypes.h:75</div></div>
<div class="ttc" id="classPxSerializerDefaultAdapter_html_a3b5eab93ab615326e85bef5a918d6974"><div class="ttname"><a href="classPxSerializerDefaultAdapter.html#a3b5eab93ab615326e85bef5a918d6974">PxSerializerDefaultAdapter::isSubordinate</a></div><div class="ttdeci">virtual bool isSubordinate() const</div><div class="ttdoc">Whether the object is subordinate. </div><div class="ttdef"><b>Definition:</b> PxSerializer.h:174</div></div>
<div class="ttc" id="PxAllocatorCallback_8h_html"><div class="ttname"><a href="PxAllocatorCallback_8h.html">PxAllocatorCallback.h</a></div></div>
<div class="ttc" id="classPxSerializerDefaultAdapter_html_a8b025cc71d171a5d5f1d1dc0fe816545"><div class="ttname"><a href="classPxSerializerDefaultAdapter.html#a8b025cc71d171a5d5f1d1dc0fe816545">PxSerializerDefaultAdapter::createObject</a></div><div class="ttdeci">virtual PxBase * createObject(PxU8 *&amp;address, PxDeserializationContext &amp;context) const</div><div class="ttdoc">Create object at a given address, resolve references and import extra data. </div><div class="ttdef"><b>Definition:</b> PxSerializer.h:232</div></div>
<div class="ttc" id="PxFoundation_8h_html"><div class="ttname"><a href="PxFoundation_8h.html">PxFoundation.h</a></div></div>
<div class="ttc" id="classPxSerializer_html_a96746551fdacb2df8da8f2887817ff5f"><div class="ttname"><a href="classPxSerializer.html#a96746551fdacb2df8da8f2887817ff5f">PxSerializer::~PxSerializer</a></div><div class="ttdeci">virtual ~PxSerializer()</div><div class="ttdef"><b>Definition:</b> PxSerializer.h:143</div></div>
<div class="ttc" id="classPxAllocatorCallback_html"><div class="ttname"><a href="classPxAllocatorCallback.html">PxAllocatorCallback</a></div><div class="ttdoc">Abstract base class for an application defined memory allocator that can be used by the Nv library...</div><div class="ttdef"><b>Definition:</b> PxAllocatorCallback.h:52</div></div>
<div class="ttc" id="classPxSerializerDefaultAdapter_html_a58327906eee1c1d30c935af420e91fcd"><div class="ttname"><a href="classPxSerializerDefaultAdapter.html#a58327906eee1c1d30c935af420e91fcd">PxSerializerDefaultAdapter::getConcreteTypeName</a></div><div class="ttdeci">virtual const char * getConcreteTypeName() const</div><div class="ttdoc">Returns string name of dynamic type. </div><div class="ttdef"><b>Definition:</b> PxSerializer.h:163</div></div>
<div class="ttc" id="group__foundation_html_ga2f06b47e22c6e93701d766444c67f3a6"><div class="ttname"><a href="group__foundation.html#ga2f06b47e22c6e93701d766444c67f3a6">PxGetFoundation</a></div><div class="ttdeci">PX_C_EXPORT PX_FOUNDATION_API physx::PxFoundation &amp;PX_CALL_CONV PxGetFoundation()</div><div class="ttdoc">Retrieves the Foundation SDK after it has been created. </div></div>
<div class="ttc" id="classPxDeserializationContext_html"><div class="ttname"><a href="classPxDeserializationContext.html">PxDeserializationContext</a></div><div class="ttdoc">Binary deserialization context class. </div><div class="ttdef"><b>Definition:</b> PxSerialFramework.h:174</div></div>
<div class="ttc" id="classPxSerializerDefaultAdapter_html_aea2cb77a709074813a634343497a4f6e"><div class="ttname"><a href="classPxSerializerDefaultAdapter.html#aea2cb77a709074813a634343497a4f6e">PxSerializerDefaultAdapter::getClassSize</a></div><div class="ttdeci">virtual size_t getClassSize() const</div><div class="ttdoc">Returns size needed to create the class instance. </div><div class="ttdef"><b>Definition:</b> PxSerializer.h:227</div></div>
<div class="ttc" id="classPxSerializationContext_html_ade8ef3b58a16bab4f4cbd3c04a891817"><div class="ttname"><a href="classPxSerializationContext.html#ade8ef3b58a16bab4f4cbd3c04a891817">PxSerializationContext::registerReference</a></div><div class="ttdeci">virtual void registerReference(PxBase &amp;base, PxU32 kind, size_t reference)=0</div><div class="ttdoc">Registers a reference value corresponding to a PxBase object. </div></div>
<div class="ttc" id="group__foundation_html_ga4a83a657390b324a460f14684e5accee"><div class="ttname"><a href="group__foundation.html#ga4a83a657390b324a460f14684e5accee">PX_ASSERT</a></div><div class="ttdeci">#define PX_ASSERT(exp)</div><div class="ttdef"><b>Definition:</b> PxAssert.h:59</div></div>
<div class="ttc" id="classPxSerializerDefaultAdapter_html_a3a59a446ea4fc277d0c224881c2f8658"><div class="ttname"><a href="classPxSerializerDefaultAdapter.html#a3a59a446ea4fc277d0c224881c2f8658">PxSerializerDefaultAdapter::PxSerializerDefaultAdapter</a></div><div class="ttdeci">PxSerializerDefaultAdapter(const char *name)</div><div class="ttdef"><b>Definition:</b> PxSerializer.h:161</div></div>
<div class="ttc" id="classPxSerializerDefaultAdapter_html_a01096d2cb96608bfbae8ab7509a9439f"><div class="ttname"><a href="classPxSerializerDefaultAdapter.html#a01096d2cb96608bfbae8ab7509a9439f">PxSerializerDefaultAdapter::registerReferences</a></div><div class="ttdeci">virtual void registerReferences(PxBase &amp;obj, PxSerializationContext &amp;s) const</div><div class="ttdoc">Register references that the object maintains to other objects. </div><div class="ttdef"><b>Definition:</b> PxSerializer.h:204</div></div>
<div class="ttc" id="classPxSerializationContext_html_a2cb3cc1613a70406c2bf89ec53035a22"><div class="ttname"><a href="classPxSerializationContext.html#a2cb3cc1613a70406c2bf89ec53035a22">PxSerializationContext::writeData</a></div><div class="ttdeci">virtual void writeData(const void *data, PxU32 size)=0</div><div class="ttdoc">Serializes object data and object extra data. </div></div>
<div class="ttc" id="classPxBase_html"><div class="ttname"><a href="classPxBase.html">PxBase</a></div><div class="ttdoc">Base class for objects that can be members of a PxCollection. </div><div class="ttdef"><b>Definition:</b> PxBase.h:73</div></div>
<div class="ttc" id="classPxSerializationContext_html"><div class="ttname"><a href="classPxSerializationContext.html">PxSerializationContext</a></div><div class="ttdoc">Binary serialization context class. </div><div class="ttdef"><b>Definition:</b> PxSerialFramework.h:99</div></div>
<div class="ttc" id="classPxProcessPxBaseCallback_html"><div class="ttname"><a href="classPxProcessPxBaseCallback.html">PxProcessPxBaseCallback</a></div><div class="ttdoc">Callback class used to process PxBase objects. </div><div class="ttdef"><b>Definition:</b> PxSerialFramework.h:81</div></div>
<div class="ttc" id="classPxSerializerDefaultAdapter_html_a12385fd1d59f49f27aed66c91b5d647c"><div class="ttname"><a href="classPxSerializerDefaultAdapter.html#a12385fd1d59f49f27aed66c91b5d647c">PxSerializerDefaultAdapter::mTypeName</a></div><div class="ttdeci">const char * mTypeName</div><div class="ttdef"><b>Definition:</b> PxSerializer.h:242</div></div>
<div class="ttc" id="classPxSerializerDefaultAdapter_html"><div class="ttname"><a href="classPxSerializerDefaultAdapter.html">PxSerializerDefaultAdapter</a></div><div class="ttdoc">Default PxSerializer implementation. </div><div class="ttdef"><b>Definition:</b> PxSerializer.h:151</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_713b4d6d20ce249967929ad234a3da6e.html">include</a></li><li class="navelem"><a class="el" href="dir_614c92edf36df8b9e1f64405ff8ea5e2.html">common</a></li><li class="navelem"><a class="el" href="PxSerializer_8h.html">PxSerializer.h</a></li>
    <li class="footer">Copyright &copy; 2008-2021 NVIDIA Corporation, 2788 San Tomas Expressway, Santa Clara, CA 95051 U.S.A. All rights reserved. <a href="http://www.nvidia.com ">www.nvidia.com</a></li>
  </ul>
</div>
</body>
</html>
